package com.itheima.quick;

import javax.servlet.*;
import javax.servlet.annotation.WebFilter;
import java.io.IOException;

//@WebFilter("/*")
public class FilterDemo1 implements Filter {

    // 初始化方法
    @Override
    public void init(FilterConfig filterConfig) throws ServletException {

    }

    // 拦截方法
    @Override
    public void doFilter(ServletRequest servletRequest, ServletResponse servletResponse, FilterChain filterChain) throws IOException, ServletException {
        System.out.println("FilterDemo1执行了...."+servletRequest);

        // 放行
        filterChain.doFilter(servletRequest, servletResponse);
    }

    // 销毁
    @Override
    public void destroy() {

    }
}
